package com.example.user.mapper;


import com.example.common.annotation.AutoFill;
import com.example.model.auth.dto.UserDTO;
import com.example.model.auth.dto.UserLoginDTO;
import com.example.model.customer.pojo.Customer;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface CustomerMapper {
    public List<Customer> list(String name, String phone);

    @AutoFill
    @Insert("insert into sm.Customer (username,password,name,email,phone,last_operation_time,last_operator) values " +
            "(#{username},#{password},#{name},#{email},#{phone},#{lastOperationTime},#{lastOperator})")
    void save(Customer customer);
    @Select("select* from sm.Customer where Customer_id=#{id}")
    Customer selectById(Integer id);
    @AutoFill
    @Update("update sm.Customer set name=#{name},email=#{email},phone=#{phone},last_operation_time=#{lastOperationTime},last_operator=#{lastOperator} where customer_id=#{customerId}")
    void updateById(Customer customer);
    //删除
    void delete(List<Integer> ids);

}
